Enhanced Error Handling for Missing Columns in Excel Input#236
Open
vinayakjeet wants to merge 3 commits intoSynBioDex:developfrom
Open
Enhanced Error Handling for Missing Columns in Excel Input#236vinayakjeet wants to merge 3 commits intoSynBioDex:developfrom
vinayakjeet wants to merge 3 commits intoSynBioDex:developfrom
Conversation
jakebeal
requested changes
Apr 7, 2024
Contributor
jakebeal
left a comment
There was a problem hiding this comment.
This pull request mixed in the described change with a number of other changes in the helper_functions.py file. There are a number of failing tests, likely caused by these other changes.
There is also not currently a new test added to demonstrate that the exception is generated and caught as intended.
Can you please address these issues in this pull request?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#46
Problem Description
When the "data sources" tab in the provided Excel files is missing a column, such as column G in older versions of the spreadsheet, the script encounters an unhandled exception and crashes. This results in an opaque error message that does not clearly indicate the cause of the problem, leading to potential confusion and making troubleshooting difficult.
Proposed Solution
To address this issue, it is suggested to wrap the section of the code that accesses potentially missing columns in a
try-exceptblock. This block should catchIndexErrorexceptions and log a warning that clearly identifies the missing column and provides guidance or suggestions for resolving the issue. The script should then continue to execute, allowing for the processing of any additional data that does not depend on the missing columns.Expected Benefits
IndexErrorexceptions, the script will no longer crash when encountering missing columns, improving its overall resilience.Additional Notes
Implementing this solution does not prevent the issue of missing columns but provides a more graceful handling mechanism that benefits users by improving error transparency and script robustness.
Closes #46